const express = require('express');
const router = express.Router();
const webhookController = require('../controllers/webhookController');
const feishuAuthMiddleware = require('../middleware/feishuAuth');

// 飞书webhook端点
router.post('/feishu', feishuAuthMiddleware, webhookController.handleWebhook.bind(webhookController));

// 健康检查端点
router.get('/health', (req, res) => {
  res.status(200).json({
    code: 0,
    message: '服务正常运行',
    timestamp: new Date().toISOString()
  });
});

module.exports = router; 